#ifndef  __DBC_IF__
#define  __DBC_IF__

#include <string>
#include <vector>

#include "dbc_frame_index.hpp"
#include "dbc_signal_index.hpp"

namespace DBC
{

extern void Init();

/// @brief: frame info
struct FrameInfo
{
    /// key
    int index;
    /// frame info
    int id;
    int length;
    /// nice to help
    std::string name;
    std::vector <int> signals;  /// index of signals
};

extern bool GetFrameInfo(const int index, FrameInfo & info);
extern bool GetFrameInfo(const int index, int & id, int & length);
extern bool GetFrameLengthById(const int id, int & length);
extern bool FindFrameIndex(const int id, int & index);

/// @brief: signal info
struct SignalInfo
{
    /// key
    int index;
    /// signal info
    int frame_id;
    int start_pos;
    int bit_length;
    /// nice to help
    std::string name;
    std::string comments;
};

extern bool GetSignalInfo(const int index, SignalInfo & info);
extern bool GetSignalInfo(const int index, int & frame_id, int & start_pos, int & bit_length);
extern bool FindSignalIndex(const int frame_id, const int start_pos, const int bit_length, int & index);

}

#endif // __DBC_IF__
